/*
 * Copyright (C), 2002-2017, 苏宁易购电子商务有限公司
 * FileName: ActivityRealtimeDataDaoImpl.java
 * Author:   15060460
 * Date:     2017年3月27日 下午3:20:02
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.member.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.suning.framework.dal.client.DalClient;
import com.suning.sawp.member.dao.ActivityRealtimeDataDao;
import com.suning.sawp.member.vo.ActivityRealtimeDataVo;
import com.suning.sawp.member.vo.QueryRealTimeDataVo;
import com.suning.sawp.service.util.BeanUtil;

/**
 * 外拓活动实时数据查询dao
 *
 * @author 15060460
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@Repository
public class ActivityRealtimeDataDaoImpl implements ActivityRealtimeDataDao {
    
    @Autowired
    DalClient dalClient;

    @Override
    public ActivityRealtimeDataVo queryRealtimeDataHq(QueryRealTimeDataVo queryVo) {
        Map<String, Object> paramMap = BeanUtil.describe(queryVo);
        return dalClient.queryForObject("realtimeData.queryRealtimeDataHq", paramMap,
                ActivityRealtimeDataVo.class);
    }

    @Override
    public List<ActivityRealtimeDataVo> queryRealtimeDataStore(QueryRealTimeDataVo queryVo,Long start,Long limit) {
        Map<String, Object> paramMap = BeanUtil.describe(queryVo);
        if(start != null && limit != null){
            paramMap.put("start", start);
            paramMap.put("limit", limit);
        }else{
            paramMap.remove("start");
            paramMap.remove("limit");
        }
        return dalClient.queryForList("realtimeData.queryRealtimeDataStore", paramMap,
                ActivityRealtimeDataVo.class);
    }

    @Override
    public Long queryRealtimeDataStoreCount(QueryRealTimeDataVo queryVo) {
        return dalClient.queryForObject("realtimeData.queryRealtimeDataStoreCount", BeanUtil.describe(queryVo),
                Long.class);
    }

    @Override
    public List<ActivityRealtimeDataVo> queryRealtimeDataCate(QueryRealTimeDataVo queryVo) {
        return dalClient.queryForList("realtimeData.queryRealtimeDataCate", BeanUtil.describe(queryVo),
                ActivityRealtimeDataVo.class);
    }

    @Override
    public List<ActivityRealtimeDataVo> queryRealtimeDataEmployee(QueryRealTimeDataVo queryVo) {
        return dalClient.queryForList("realtimeData.queryRealtimeDataEmployee", BeanUtil.describe(queryVo),
                ActivityRealtimeDataVo.class);
    }

    @Override
    public List<ActivityRealtimeDataVo> queryRealtimeDataPlace(QueryRealTimeDataVo queryVo) {
        return dalClient.queryForList("realtimeData.queryRealtimeDataPlace", BeanUtil.describe(queryVo),
                ActivityRealtimeDataVo.class);
    }

    @Override
    public List<ActivityRealtimeDataVo> queryRealtimeDataEmployeeByCateCode(QueryRealTimeDataVo queryVo) {
        return dalClient.queryForList("realtimeData.queryRealtimeDataEmployeeByCateCode", BeanUtil.describe(queryVo),
                ActivityRealtimeDataVo.class);
    }

}
